﻿#region Using namespaces

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;

using BOL.Apps.GeneNetworkBrowser;

#endregion

namespace BOL.Apps.GeneNetworkBrowser.ViewModels
{
    public sealed class NetworkTreeViewItemViewModel : TreeViewItemViewModel
    {
        #region TreeViewItemViewModel implementation

        public Network Network { get; private set; }

        public NetworkTreeViewItemViewModel(Network network, NetworksTreeViewItemViewModel tvmNetworks)
            : base(tvmNetworks, true)
        {
            Network = network;
            _title = network.Name;

            var addGeneValuesCommand = new RelayCommand(param => System.Windows.MessageBox.Show("Add gene values..."));
            AddContextMenu("Add gene values...", addGeneValuesCommand);
        }

        protected override void LoadChildren()
        {
            base.Children.Add(new GenesTreeViewItemViewModel(new ObservableCollection<Gene>(Network.Vertices), this));
            base.Children.Add(new RelationsTreeViewItemViewModel(new ObservableCollection<Relation>(Network.Edges), this));
        }

        #endregion
    }
}
